<template>
  <div class="app-container">
    <!-- 引入Header组件 -->
    <Header 
      :title="appTitle"
      :userName="currentUser"
      :navLinks="navigationLinks"
    />
    
    <!-- 主内容区域 -->
    <main class="main-content">
      <h2>欢迎使用Vue导航组件示例</h2>
      <p>这是一个展示可复用页面头部横向导航组件的示例项目。</p>
      <div class="features">
        <div class="feature-card">
          <h3>左侧Logo + 标题</h3>
          <p>包含自定义SVG图标和应用标题，支持通过属性自定义。</p>
        </div>
        <div class="feature-card">
          <h3>中间导航链接</h3>
          <p>可配置的导航菜单，支持悬停效果和动画。</p>
        </div>
        <div class="feature-card">
          <h3>右侧用户菜单</h3>
          <p>包含用户头像、用户名和下拉菜单，支持点击外部关闭。</p>
        </div>
      </div>
    </main>
  </div>
</template>

<script setup lang="ts">
// 导入Header组件
import Header from './components/Header.vue';

// 应用标题
const appTitle = 'Vue Navigation App';

// 当前用户名
const currentUser = '张三';

// 导航链接配置
const navigationLinks = [
  { id: 'home', text: '首页', href: '#home' },
  { id: 'dashboard', text: '仪表盘', href: '#dashboard' },
  { id: 'products', text: '产品管理', href: '#products' },
  { id: 'analytics', text: '数据分析', href: '#analytics' },
  { id: 'settings', text: '系统设置', href: '#settings' }
];
</script>

<style>
/* 重置样式 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: #f5f7fa;
  color: #333;
  line-height: 1.6;
  margin: 0;
  padding: 0;
}

/* 应用容器 */
.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 主内容区域 */
.main-content {
  flex: 1;
  margin-top: 64px; /* 与Header高度一致，避免内容被遮挡 */
  padding: 40px 24px;
  max-width: 1200px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.main-content h2 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 16px;
  color: #2c3e50;
}

.main-content p {
  font-size: 16px;
  color: #64748b;
  margin-bottom: 32px;
}

/* 特性卡片 */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 32px;
}

.feature-card {
  background-color: white;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.feature-card h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #2c3e50;
}

.feature-card p {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .main-content {
    padding: 24px 16px;
  }
  
  .main-content h2 {
    font-size: 24px;
  }
  
  .features {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}
</style>